<%--                                                                       --%>
<%-- Copyright (c) 2004 BroadVision, Inc.  All rights reserved.            --%>
<%--                                                                       --%>
<%-- This software is copyrighted. Under the copyright laws, this software --%>
<%-- may not be copied, in whole or in part, without prior written consent --%>
<%-- of BroadVision, Inc. or its assignees. This software is provided      --%>
<%-- under the terms of a license between BroadVision and the recipient,   --%>
<%-- and its use is subject to the terms of that license.                  --%>
<%--                                                                       --%>
<%-- This software may be protected by one or more U.S. and International  --%>
<%-- patents.  Certain applications of BroadVision One-To-One software are --%>
<%-- covered by U.S. patent 5,710,887.                                     --%>
<%--                                                                       --%>
<%-- TRADEMARKS: BroadVision and BroadVision One-To-One are registered     --%>
<%-- trademarks of BroadVision, Inc., in the United States and the         --%>
<%-- European Community, and are trademarks of BroadVision, Inc., in other --%>
<%-- countries.  The BroadVision logo, is a trademark of BroadVision,      --%>
<%-- Inc., in the United States and other countries. Additionally, IONA    --%>
<%-- and Orbix are trademarks of IONA Technologies, Ltd.  RSA, MD5, and    --%>
<%-- RC2 are trademarks of RSA Data Security, Inc.                         --%>
<%--                                                                       --%>

<%@ taglib uri="/WEB-INF/struts-html-el.tld" prefix="html-el" %>
<%@ taglib uri="/WEB-INF/struts-bean-el.tld" prefix="bean-el" %>
<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>

<script language="JavaScript">

  function doDisplayTemplateEditAction(myform) {
    var id = myform.displayTemplateId.value;
    if (id == 0) {
      myform.displayTemplateId.value = <%= request.getAttribute("displayTemplateId") %>
    }
    myform.submit();
  }

  function doDisplayTemplateDeleteAction(myform) {
    if (confirm('<bean-el:message key="ep.display.template.confirm.delete" bundle="ep.messages"/>') != true) {
      return;
    }
    var id = myform.displayTemplateId.value;
    if (id == 0) {
      myform.displayTemplateId.value = <%= request.getAttribute("displayTemplateId") %>
    }
    myform.goBackAction.value = '/ep/blockDisplayTemplateList.do';
    myform.action = '<c:url value="/ep/blockDisplayTemplateDelete.do"/>';
    myform.submit();
  }

</script>

<html-el:form action="/ep/blockDisplayTemplateEdit.do">
<input type="hidden" name="displayTemplateId" value="<c:out value='${param.displayTemplateId}'/>"/>
<input type="hidden" name="goBackAction">
<table class="zoneFive" width="100%" border="0" cellspacing="0" cellpadding="0" summary="content area">
  <tr>
    <td valign="top" width="100%">
      <div class="pageTitle">
        <bean-el:message key="ep.block.display.template.view.page.title" arg0="${epDisplayTemplateView.map.name}" bundle="ep.messages"/>
      </div>
      <div class="errorMessage"><html-el:errors bundle="ep.messages"/></div>
      <div class="pageSubtitle">
        <span class="left">
          <bean-el:message key="ep.display.template.information" bundle="ep.messages"/>
        </span>
        <span class="right">
          <input type="button" class="inputButton" value='<bean-el:message key="button.edit" bundle="ep.messages"/>'
            onclick="doDisplayTemplateEditAction(this.form);">
<c:if test="${epDisplayTemplateView.map.referencesCount <= 0}">
          <input type="button" class="inputButton" value='<bean-el:message key="button.delete" bundle="ep.messages"/>'
            onclick="doDisplayTemplateDeleteAction(this.form);">
</c:if>
        </span>
      </div> 
      <table class="labelForm" width="100%" border="0" cellspacing="0" cellpadding="0" summary="<bean-el:message key='ep.display.template' bundle="ep.messages"/>">
        <tr> 
          <td class="label" width="30%">
            <bean-el:message key="ep.display.template.name" bundle="ep.messages"/>:
          </td>
          <td class="labelField" width="70%">
            <c:out value="${epDisplayTemplateView.map.name}"/>
          </td>
        </tr>
        <tr> 
          <td class="label" width="30%">
            <bean-el:message key="ep.display.template.description" bundle="ep.messages"/>:
          </td>
          <td class="labelField" width="70%">
            <c:out value="${epDisplayTemplateView.map.description}"/>
          </td>
        </tr>
        <tr> 
          <td class="label" width="30%">
            <bean-el:message key="ep.display.template.script" bundle="ep.messages"/>:
          </td>
          <td class="labelField" width="70%">
            <c:out value="${epDisplayTemplateView.map.primaryScriptPath}"/>
          </td>
        </tr>
      </table>
    </td> 
  </tr>
</table>
</html-el:form> 
